﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CCWin;

namespace SCCM
{
    public partial class Authorized : Skin_Mac
    {
        public Authorized()
        {
            InitializeComponent();
        }

        private void changePwdButton_Click(object sender, EventArgs e)
        {
            this.changePwdButton.Visible = true;
            this.changePwdLabel.Visible = true;
            this.pwdLable.Text = "旧密码:";
            this.okButton.Enabled = false;
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            DataBase db = new DataBase();
            String passwd = db.getPwd();
            String inputPwd = pwdTextBox.Text.Trim();
            if (inputPwd.Equals(passwd))
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else {
                MessageBox.Show("密码输入错误");
            }
        }

        private void pwdTextBox_SkinTxt_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter) {
                this.okButton_Click(okButton, e);
            }
        }
    }
}
